#ifndef CUSTOMAPPLICATION_H
#define CUSTOMAPPLICATION_H

#include "mainwindow.h"
#include <QApplication>
#include "loginform.h"
#include "ui_loginform.h"
#include <QKeyEvent>
#include <QDebug>
#include "objectworkerthread.h"
#include <QWaitCondition>
#include <QMutex>
class CustomApplication : public QApplication
{
    Q_OBJECT  // 必须有这个宏
public:
    LoginForm w;
    MainWindow mainWindow;
    QThread *m_thread;              // 线程
    ObjectWorkerThread *m_worker;   // 线程任务对象
    // 成员变量用于存储线程传递的数据
    QStringList m_times;
    QStringList m_currents;
    QStringList m_voltages;
    QStringList m_powers;

    CustomApplication(int argc, char* argv[]) : QApplication(argc, argv) {

        Init_customapplication();


    }
    void Init_customapplication();

    bool notify(QObject *receiver, QEvent *event) override {
        return QApplication::notify(receiver, event);
    }

signals:
    void sendData(const QStringList &times,
                  const QStringList &currents,
                  const QStringList &voltages,
                  const QStringList &powers);

};

#endif // CUSTOMAPPLICATION_H
